#ifndef IAP_SERVER_H
#define IAP_SERVER_H

#include <QWidget>
#include <QTcpServer> //监听套接字
#include <QTcpSocket> //通信套接字
#include <QFile>
#include <QTimer>

namespace Ui {
class IAP_Server;
}

class IAP_Server : public QWidget
{
    Q_OBJECT

public:
    explicit IAP_Server(QWidget *parent = 0);
    ~IAP_Server();

    void sendData();//发送文件数据

private slots:
    void on_buttonBind_clicked();

    void on_buttonSelectFiles_clicked();

    void on_buttonStartSend_clicked();

    void on_buttonStopSend_clicked();

    void on_horizontalSlider_actionTriggered(int action);

    void on_horizontalSlider_sliderMoved(int position);

    void on_buttonDIsconnect_clicked();

private:
    Ui::IAP_Server *ui;
    QTcpServer *tcpServer;
    QTcpSocket *tcpSocket;

    QFile file;

    QString fileName;//文件名字
    qint64 fileSize;//文件大小

    qint64 sendSize;//已经发送文件的大小
    QTimer timer;
};

#endif // IAP_SERVER_H
